/* $RCSFile: ADNDynSavedquery.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/DynEntities/ADNDynSavedquery.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:33  christian.surieux
 *   Added Log to All cs files
 */

/* Copyrights Christian Surieux 2010 */
/* Class ADNDynSavedquery */
/* Date 2010-01-10 19:52:03Z */

using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;

using CrmSdk;

namespace AddonNice.CRMWrapper
{
    /// <summary>
    /// Beware no statecode
    /// </summary>
 	public class ADNDynSavedquery : ADNDynXmlView
	{
		/* Internal class for DynTypes */
		protected class Ftor: DFactor
		{
			public Ftor() : base(CrmStr.savedquery){}
			public override Type DynType
			{	get{return typeof(ADNDynSavedquery);}}
			public override string DynTypename
			{	get{return CrmStr.savedquery;}}
			public override DynEntity Build()
			{	return new ADNDynSavedquery();}
			public override DynEntity Build(CRMWrapperBase w, InternalDynamicEntity dEntity, PropertyDescriptorCollection wproperties)
			{	return new ADNDynSavedquery(w, dEntity, wproperties, null);}
			public override DynEntity Build(CRMWrapperBase w, string PrimaryFieldValue)
			{	return new ADNDynSavedquery(w, PrimaryFieldValue);}
			public override DynEntity Build(CRMWrapperBase w,Guid PrimaryKeyValue)
			{	return new ADNDynSavedquery(w,PrimaryKeyValue);}
		}
		/* Static Ctor to register in DynTypes */
		static ADNDynSavedquery(){new Ftor();}

		public override bool HasOwnerProperty
		{	get{ return false;}}
		
        public ADNDynSavedquery(): base(){}
		public ADNDynSavedquery(CRMWrapperBase w, string PrimaryFieldValue): base(w, CrmStr.savedquery)
		{
			if ( PrimaryFieldValue != string.Empty )
			    name	=   PrimaryFieldValue;
		}
		public ADNDynSavedquery(CRMWrapperBase w, Guid CrmId): base(w,CrmStr.savedquery, CrmId){}
		public ADNDynSavedquery(CRMWrapperBase w, InternalDynamicEntity e): base(w,CrmStr.savedquery,e,null,null){}
		public ADNDynSavedquery(CRMWrapperBase w, InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s): base(w,CrmStr.savedquery,e,prop,s){}
		public ADNDynSavedquery(ResetWrapperHandler fn, string PrimaryFieldValue): base(fn,CrmStr.savedquery)
		{
			if ( PrimaryFieldValue != string.Empty )
				name	=   PrimaryFieldValue;
		}
		public ADNDynSavedquery(ResetWrapperHandler fn, Guid CrmId): base(fn,CrmStr.savedquery,CrmId){}
		public ADNDynSavedquery(ResetWrapperHandler fn,InternalDynamicEntity e): base(fn,CrmStr.savedquery,e,null,null){}
		public ADNDynSavedquery(ResetWrapperHandler fn,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s): base(fn,CrmStr.savedquery,e,prop,s){}

		/* Properties */

		[CrmDynAttribute(CrmStr.savedquery)]
		public Guid savedqueryid
		{
		    get	{	 return KeyPropertyValue(CrmStr.savedqueryid);}
		    set	{	AddKeyProperty(CrmStr.savedqueryid, value);}
		}
		protected override void SetCrmIdProperty(Guid crmId)
		{
			if ( !dicProperty.ContainsKey(CrmStr.savedqueryid)  || KeyPropertyValue(CrmStr.savedqueryid) != crmId )
				savedqueryid	=   crmId;
		}
		public override Guid PrimaryKeyGuidValue
		{
		    get	{	return savedqueryid;}
		    set{	savedqueryid	=value;}
		}

        [CrmDynAttribute(CrmStr.savedquery)]
		public int customizationlevel
		{
		    get	{	 return NumberPropertyValue(CrmStr.customizationlevel);}
		    set	{	AddNumberProperty(CrmStr.customizationlevel, value);}
		}


		[CrmDynAttribute(CrmStr.savedquery)]
		public bool inproduction
		{
			get	{	 return BooleanPropertyValue(CrmStr.inproduction);}
		    set	{	AddBooleanProperty(CrmStr.inproduction, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public bool iscustomizable
		{
			get	{	 return BooleanPropertyValue(CrmStr.iscustomizable);}
		    set	{	AddBooleanProperty(CrmStr.iscustomizable, value);}
		}


		[CrmDynAttribute(CrmStr.savedquery)]
		public bool isdefault
		{
			get	{	 return BooleanPropertyValue(CrmStr.isdefault);}
		    set	{	AddBooleanProperty(CrmStr.isdefault, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public bool isprivate
		{
			get	{	 return BooleanPropertyValue(CrmStr.isprivate);}
		    set	{	AddBooleanProperty(CrmStr.isprivate, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public bool isquickfindquery
		{
			get	{	 return BooleanPropertyValue(CrmStr.isquickfindquery);}
	    	set	{	AddBooleanProperty(CrmStr.isquickfindquery, value);}
		}


		[CrmDynAttribute(CrmStr.savedquery)]
		public bool isuserdefined
		{
			get	{	 return BooleanPropertyValue(CrmStr.isuserdefined);}
    		set	{	AddBooleanProperty(CrmStr.isuserdefined, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public string latestcolumnsetxml
		{
		    get	{	 return StringPropertyValue(CrmStr.latestcolumnsetxml);}
		    set	{	AddStringProperty(CrmStr.latestcolumnsetxml, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public string latestdescription
		{
		    get	{	 return StringPropertyValue(CrmStr.latestdescription);}
		    set	{	AddStringProperty(CrmStr.latestdescription, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public string latestfetchxml
		{
		    get	{	 return StringPropertyValue(CrmStr.latestfetchxml);}
		    set	{	AddStringProperty(CrmStr.latestfetchxml, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public string latestlayoutxml
		{
		    get	{	 return StringPropertyValue(CrmStr.latestlayoutxml);}
		    set	{	AddStringProperty(CrmStr.latestlayoutxml, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public string latestname
		{
		    get	{	 return StringPropertyValue(CrmStr.latestname);}
		    set	{	AddStringProperty(CrmStr.latestname, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public string queryapi
		{
		    get	{	 return StringPropertyValue(CrmStr.queryapi);}
		    set	{	AddStringProperty(CrmStr.queryapi, value);}
		}

		[CrmDynAttribute(CrmStr.savedquery)]
		public int queryappusage
		{
		    get	{	 return NumberPropertyValue(CrmStr.queryappusage);}
		    set	{	AddNumberProperty(CrmStr.queryappusage, value);}
		}


		[CrmDynAttribute(CrmStr.savedquery)]
		public Guid savedqueryidunique
		{
		    get	{	 return UniqueIdentifierPropertyValue(CrmStr.savedqueryidunique);}
		    set	{	AddUniqueIdentifierProperty(CrmStr.savedqueryidunique, value);}
		}

 	}
}